3 Copyright (C) 2013 Therp BV
4 License: GNU AFFERO GENERAL PUBLIC LICENSE
5 Version 3 or any later version
7 Disable default search on the default journal and period
8 in the javascript search extension on move lines in
9 openobject-addons/account/static/src/js/account_move_line_quickadd.js
11 openerp
.account_move_line_no_default_search = function (instance
) {
12 instance
.web
.account
.QuickAddListView
.include({
15 Set a hook to be honoured in our override of do_search()
16 so as to prevent a default search on account move lines
17 on the default period and journal.
19 this.block_default_search
= true;
20 return this._super
.apply(this, arguments
);
23 do_search: function(domain
, context
, group_by
) {
25 Check for a flag to block default search
26 and reset default values when it has been found,
27 then reset the blocking flag.
29 if (this.block_default_search
=== true) {
30 this.current_journal
= null;
31 this.current_period
= null;
32 this.block_default_search
= false;
34 return this._super
.apply(this, arguments
);